<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.turing.selfwebservice.common.Toolkit"%>
<%@page import="com.turing.selfwebservice.util.ServletUtil"%>
<%@page
	import="com.turing.selfwebservice.cardholderuser.AccountTradDetailObj"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 4.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<base href="<%=basePath%>" />
		<title>卡交易明细</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<link href="<%=path %>/css/c.css" rel="stylesheet" type="text/css" />
		<link href="<%=path %>/js/plugs/ui/css/south-street/jquery-ui-1.9.2.custom.min.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="<%=path %>/js/jquery.js"></script>

		<script type="text/javascript" src="<%=path %>/js/WdatePicker.js"></script>
		<script type="text/javascript" src="<%=path %>/js/plugs/ui/jquery-ui-1.9.2.custom.min.js"></script>
		<script type="text/javascript" src="<%=path %>/js/cdatePicker.js"></script>
		<script type="text/javascript" src="<%=path %>/js/common.js"></script>
		<script>
			$(function(){
				var start = $("#htStart"),end = $("#htEnd");
				start.cdatePicker();
				end.cdatePicker();
				
				start.bind("confirm",function(){
					end.cdatePicker("mindate",start.val());
				});
				
				end.bind("confirm",function(){
					start.cdatePicker("maxdate",end.val());
				});
			});
		</script>
	</head>
	<%
		List<AccountTradDetailObj> accountTradDetailObjs = (List<AccountTradDetailObj>) request
				.getAttribute("accountTradDetailObjs");
		String startTranDate = request.getParameter("startTranDate");
		if (ServletUtil.isEmpty(startTranDate))
			startTranDate = Toolkit.dateTostring();
		String endTranDate = request.getParameter("endTranDate");
		if (ServletUtil.isEmpty(endTranDate))
			endTranDate = Toolkit.dateTostring();
	%>
	<body class="body">
		<div id="searchForm">
			<form action="cardHolderUserServlet.do?method=CardTradDetail"
				method="post">
				<table class="infoTable noAutoClass">
					<tr>
						<td scope="col" align="center" nowrap>
							卡号：
							<%=request.getAttribute("cardNo")%>
							<input type="hidden" name="cardNo" id="cardNo"
								value="<%=request.getAttribute("cardNo")%>" />
						</td>
						<td scope="col" align="center">
							时间范围：
							 <input id="htStart" type="text" style="width: 100px;"
								value="<%=startTranDate%>" name="startTranDate"
								maxDate="now" />
							<input id="htEnd" type="text" style="width: 100px;" name="endTranDate"
							 	value="<%=endTranDate%>"
								minDate="now"/>
						</td>
						<td align="right">
							<input type="submit" value="查询" />
						</td>
					</tr>
				</table>
			</form>
		</div>
		<%
			if (null != accountTradDetailObjs) {
		%>
		<table class="infoTable noAutoClass" style="margin-top: 12px;">
			<tr class="tableTitle">
				<td width="15%">
					交易时间
				</td>
				<td width="15%">
					交易类型
				</td>
				<td width="15%" align="right">
					借方发生额(元)
				</td>
				<td width="15%" align="right">
					贷方发生额(元)
				</td>
				<td width="10%" align="right">
					余额(元)
				</td>
				<td width="30%">
					交易摘要
				</td>
			</tr>
			<%
				if (accountTradDetailObjs.size() > 0) {
						for (AccountTradDetailObj d : accountTradDetailObjs) {
			%>
			<tr>
				<td>
					<%=d.getTranTime()%>
				</td>
				<td>
					<%=d.getTranType()%>
				</td>
				<td align="right">
					<%=d.getDebitAmount()%>
				</td>
				<td align="right">
					<%=d.getCreditAmount()%>
				</td>
				<td align="right">
					<%=d.getBalance()%>
				</td>
				<td>
					<%=d.getRemark()%>
				</td>
			</tr>
			<%
				}
			%>
			<tr>
				<td colspan="6" class="pageControlContainer"><%@ include file="/common/pageControl.jsp"%>
				</td>
			</tr>
			<%
				} else {
			%>
			<tr>
				<td colspan="6">
					无交易数据
				</td>
			</tr>
			<%
				}
			%>
		</table>
		<%
			}
		%>
	</body>
</html>
